﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DesIt : MonoBehaviour
{
    public float liveLife;
    float timeNow;

    // Use this for initialization
    void Start()
    {
       
    }

    // Update is called once per frame
    void Update()
    {
        if(Time.time>timeNow)
        {
            Destroy(gameObject);
        }
        
    }

    public void SetLiveTime(float percent)
    {
        timeNow = Time.time + liveLife*percent;
    }
}
